<script lang="ts" setup>
import { findBanner } from '@/api/home'
import type { FindBannerType } from '@/types/home'
import { ref, onBeforeMount } from 'vue'
// 定义渲染数组
const sliders = ref<FindBannerType[]>([])
onBeforeMount(async () => {
  // 请求数据
  const res = await findBanner()
  sliders.value = res.result
})
</script>

<template>
  <div class="home-banner">
    <XtxCarousel :sliders="sliders" />
  </div>
</template>

<style scoped lang="less">
.home-banner {
  width: 1240px;
  height: 500px;
  position: absolute;
  left: 0;
  top: 0;
  z-index: 98;
}
:deep(.xtx-carousel) {
  .carousel-btn.prev {
    left: 270px;
  }
  .carousel-indicator {
    padding-left: 250px;
  }
}
</style>
